//
//  forwordCell.swift
//  kingWeiBo
//
//  Created by King on 15/9/17.
//  Copyright © 2015年 King. All rights reserved.
//

import UIKit

class forwordCell: stateCell {
    
    
    override var status:Status?{
        didSet{
            let name = status?.retweeted_status?.user?.name ?? ""
            let text = status?.retweeted_status?.text ?? ""
            forwordLabel.text = "@" + name + ":\n" + text
        
        }
        
    }

 
    override func setUpUI() {
        super.setUpUI()
        contentView.insertSubview(backButton, belowSubview: picCV)
        contentView.insertSubview(forwordLabel, aboveSubview: picCV)
        
        backButton.ff_AlignVertical(type: ff_AlignType.BottomLeft, referView: textLable, size: nil)
        backButton.ff_AlignVertical(type: ff_AlignType.TopRight, referView: bottomview, size: nil)
        
        forwordLabel.ff_AlignInner(type: ff_AlignType.TopLeft, referView: backButton, size: nil, offset: CGPoint(x: 8, y:8))

        
        let cons = picCV.ff_AlignVertical(type: ff_AlignType.BottomLeft, referView: forwordLabel, size: CGSize(width: 290, height: 290), offset: CGPoint(x: -8, y: 8))
        picHeightCons = picCV.ff_Constraint(cons, attribute: NSLayoutAttribute.Height)
        picWidthCons = picCV.ff_Constraint(cons, attribute: NSLayoutAttribute.Width)
        pictureTopCons = picCV.ff_Constraint(cons, attribute: NSLayoutAttribute.Top)
        
        
    }
    
    
    
    //MARK: - 懒加载控件
    private lazy var forwordLabel:UILabel={
    
        let lab = UILabel()
//        lab.text = "wojiushilaizhengjiunide"
        lab.numberOfLines = 0
        lab.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 20
        return lab
    
    }()
    
    private lazy var backButton:UIButton={
        
        let btn = UIButton()
//        btn.backgroundColor = UIColor.blueColor()
        return btn
    }()
}
